<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'advertisement-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
	<?php 
		if (!$model->isNewRecord) {
			echo $form->labelEx($model,'number');
			echo $model->number;
		}
	?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'typeId'); ?>
		<?php echo $form->dropDownList($model,'typeId',AdvertisementType::model()->getAllTypes(),
			array('empty'=>'')); ?>
		<?php echo $form->error($model,'typeId'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'size'); ?>
		<?php echo $form->textField($model,'size'); ?>
		<span class='hint'>(1-60)</span>
		<?php echo $form->error($model,'size'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'content'); ?>
		<?php echo $form->textArea($model,'content',array('rows'=>20, 'cols'=>80)); ?>
		<?php echo $form->error($model,'content'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'startTime'); ?>
		<?php echo $form->hiddenField($model,'startTime'); ?>
		<?php
			$this->widget('zii.widgets.jui.CJuiDatePicker', array(
		    	'name'=>'startTimeSelect',
		    	'options'=>array(
					'altField'=>'#'.CHtml::activeId($model, "startTime"),	
		    	),
		    	'value'=>$model->startTime,
			));
		?>		
		<?php echo $form->error($model,'startTime'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'endTime'); ?>
		<?php echo $form->hiddenField($model,'endTime'); ?>
		<?php
			$this->widget('zii.widgets.jui.CJuiDatePicker', array(
		    	'name'=>'endTimeSelect',
		    	'options'=>array(
					'altField'=>'#'.CHtml::activeId($model, "endTime"),	
		    	),
		    	'value'=>$model->endTime,
			));
		?>
		<?php echo $form->error($model,'endTime'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'client'); ?>
		<?php echo $form->textField($model,'client',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'client'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'clientPhone'); ?>
		<?php echo $form->textField($model,'clientPhone',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'clientPhone'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'clientEmail'); ?>
		<?php echo $form->textField($model,'clientEmail',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'clientEmail'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'clientAddress'); ?>
		<?php echo $form->textField($model,'clientAddress',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'clientAddress'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'price'); ?>
		<?php echo $form->textField($model,'price',array('size'=>6,'maxlength'=>6)); ?>
		<span class='hint'>(Format: 8888.88)</span>
		<?php echo $form->error($model,'price'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'paymentType'); ?>
		<?php echo $form->dropDownList($model,'paymentType',Advertisement::model()->getAllPaymentTypes(),
			array('empty'=>'')); ?>
		<?php echo $form->error($model,'paymentType'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'paymentDate'); ?>
		<?php echo $form->hiddenField($model,'paymentDate'); ?>
		<?php
			$this->widget('zii.widgets.jui.CJuiDatePicker', array(
		    	'name'=>'paymentDateSelect',
		    	'options'=>array(
					'altField'=>'#'.CHtml::activeId($model, "paymentDate"),	
		    	),
		    	'value'=>$model->paymentDate,
			));
		?>
		<?php echo $form->error($model,'paymentDate'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'memo'); ?>
		<?php echo $form->textArea($model,'memo',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'memo'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->